<template>
  <div class="user-center">
    <div class="user-center-head">
      <div class="user-head">
        <!-- <div class="user-head-bg"></div> -->
        <img
          class="user-head-bg"
          src="@/assets/common/user_center.png"
          alt=""
        />
        <!-- <div class="user-head-logo"></div> -->

        <img
          class="user-head-logo"
          src="@/assets/common/user_head_logo.png"
          alt=""
        />
      </div>

      <div class="user-center-head-container">
        <img class="ic-20" src="@/assets/common/man_user_center.png" alt="" />
        <div class="user-info">
          <div class="realname">{{ userInfo.account_name }}</div>
          <div class="username">{{ userInfo.account }}</div>
        </div>
      </div>
    </div>
    <div class="user-center-content">
      <div class="item-title">
        <div class="title-icon"></div>
        <div class="item-name">基本信息</div>
      </div>
      <div class="item-list">
        <div class="list-wrap" :style="{ width: '100%' }">
          <div class="list-label">所属部门：</div>
          <div class="list-value">
            {{ userInfo.dept_name ? userInfo.dept_name : "-" }}
          </div>
        </div>
        <div class="list-wrap" :style="{ width: '100%' }">
          <div class="list-label">用户角色：</div>
          <div class="list-value">{{ userInfo.role_name }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "UserCenter",
  computed: {
    ...mapGetters(["userInfo"]),
  },
  data: () => ({}),
};
</script>

<style lang="scss" scoped>
.user-center {
  border: 1px solid #ffffff;
  border-radius: 8px;
  background: linear-gradient(
      180deg,
      rgba(34, 39, 209, 0.1) 0%,
      rgba(34, 39, 209, 0) 30%
    ),
    #ffffff;
  width: 100%;
  height: 100%;
  padding: 24px;
  .user-head {
    position: relative;
    overflow: hidden;

    .user-head-bg {
      width: 100%;
      height: 128px;
      object-fit: cover;
      border-radius: 6px;
      border: 1px #fff solid;
    }
    .user-head-logo {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      right: 0;
    }
  }

  .user-center-head {
    height: auto;
    position: relative;
    .user-center-head-container {
      display: flex;
      position: absolute;
      height: 100%;
      top: 0;
      align-items: center;
      left: 40px;
      .ic-20 {
        width: 80px;
        height: 80px;
      }
      .user-info {
        margin-left: 16px;
      }
      .realname {
        font-weight: 600;
        font-size: 24px;
        margin-bottom: 4px;
      }
    }
  }
  .user-center-content {
    margin-top: 24px;
    width: 100%;
    .item-title {
      position: relative;
      padding-left: 10px;
      margin-bottom: 16px;
      .title-icon {
        position: absolute;
        left: 0;
        top: 4px;
        width: 4px;
        height: 14px;
        border-radius: 4px;
        background: linear-gradient(
          180deg,
          rgba(107, 114, 255, 1) 0%,
          rgba(34, 39, 209, 1) 100%
        );
      }
      .item-name {
        color: rgba(#000, 0.9);
        font-weight: 600;
        font-size: 16px;
      }
    }
    .item-list {
      // width: 70%;
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      .list-wrap {
        display: flex;
        align-items: baseline;
        margin-bottom: 16px;
        // min-width: 50%;
        .list-label {
          // padding-right: 8px;
          text-align: right;
          font-weight: 400;
          font-size: 14px;
          color: rgba(#000, 0.4);
        }
        .list-value {
          flex: 1;
          min-width: 300px;
          color: rgba(#000, 0.9);
          word-break: break-all;
          width: 0;
          font-size: 14px;
          font-weight: 400;
        }
      }
    }
  }
}
</style>
